﻿using System;
using System.Web.Mvc;
using MyAMS.WebServer.Models;
using MyAMS.WebServer.Services;

namespace MyAMS.WebServer.Controllers
{
    /// <summary>
    /// 数据控制器
    /// </summary>
    public class ArchiveController : Controller
    {
        private readonly IArchiveService archiveService;

        /// <summary>
        /// 初始化一个新的 <see cref="ArchiveController"/> 类的实例
        /// </summary>
        /// <param name="archiveService">数据服务</param>
        public ArchiveController(IArchiveService archiveService)
        {
            this.archiveService = archiveService;
        }

        /// <summary>
        /// 显示一个数据的详细信息
        /// </summary>
        /// <returns></returns>
        public ActionResult Details(Guid id)
        {
            Archive archive = archiveService.Get(id);
            return View(archive);
        }
    }
}
